home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2004 #11
/
Amiga Plus CD - 2004 - No. 11.iso
/
AmiSoft
/
Misc
/
emu
/
p-interp.lha
/
p-interp-0.5
/
arexxturtleserver.e
< prev
next >
Wrap
Text File
|
2002-05-08
|
3KB
|
97 lines
/*
Turtlegraphics server (to use the apple pascal unit)
Copyright © 2001/02 Stefan Haubenthal
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
MODULE 'tools/arexx'
CONST XSIZE=280
CONST YSIZE=192
DEF currentViewPort
DEF currentPenColor
DEF currentTurtleX
DEF currentTurtleY
DEF currentTurtleAng
DEF currentCharType
DEF wptr
PROC main()
rx_HandleAll({turtleCommandHandler},'TURTLESERVER')
IF wptr THEN CloseW(wptr)
ENDPROC
PROC turtleCommandHandler(buffer)
WriteF('Received message "\s" from ARexx!\n',buffer)
IF CtrlC() THEN RETURN
IF StrCmp(buffer, 'INITTURTLE') THEN initTurtle(0,0)
IF StrCmp(buffer, 'TURN') THEN turnTo(0)
IF StrCmp(buffer, 'TURNTO') THEN turnTo(0)
IF StrCmp(buffer, 'MOVE') THEN moveTo(0,0)
IF StrCmp(buffer, 'MOVETO') THEN moveTo(0,0)
IF StrCmp(buffer, 'PENCOLOR') THEN currentPenColor:=NIL
IF StrCmp(buffer, 'TEXTMODE') THEN NIL
IF StrCmp(buffer, 'GRAFMODE') THEN NIL
IF StrCmp(buffer, 'FILLSCREEN') THEN fillScreen(0)
IF StrCmp(buffer, 'VIEWPORT') THEN currentViewPort:=NIL
IF StrCmp(buffer, 'TURTLEX') THEN currentTurtleX:=NIL
IF StrCmp(buffer, 'TURTLEY') THEN currentTurtleY:=NIL
IF StrCmp(buffer, 'TURTLEANG') THEN currentTurtleAng:=NIL
IF StrCmp(buffer, 'SCREENBIT') THEN NIL
IF StrCmp(buffer, 'DRAWBLOCK') THEN drawByte(0,0,0,0,0,0)
IF StrCmp(buffer, 'WCHAR') THEN wChar(0)
IF StrCmp(buffer, 'WSTRING') THEN NIL
IF StrCmp(buffer, 'CHARTYPE') THEN currentCharType:=NIL
ENDPROC StrCmp(UpperStr(buffer),'QUIT'),0,'result!'
PROC initTurtle(width,height)
VOID width
VOID height
IF wptr=0 THEN wptr:=OpenW(20,50,XSIZE,YSIZE,0,0,'ARexxTurtlegraphicsServer',NIL,1,0)
ENDPROC
PROC turnTo(angle)
currentTurtleAng:=angle
ENDPROC
PROC moveTo(x,y)
Plot(x, y, currentPenColor)
ENDPROC
PROC fillScreen(color)
Colour(color)
ENDPROC
PROC wChar(ch)
TextF(currentTurtleX, currentTurtleY, ch)
ENDPROC
PROC drawByte(data,xSkip,width,xScreen,yScreen,mode)
xSkip
width
mode
VOID {systemCharset}
TextF(xScreen, yScreen, data)
ENDPROC
systemCharset: INCBIN 'system.charset'
VOID '$VER: arexxturtleserver 0.2 $'